import {createRouter, createWebHistory} from 'vue-router'

import LoginVue from '@/views/Login.vue'
import LayoutVue from '@/views/Layout.vue'

import StudentManageVue from "@/views/student/StudentManage.vue";
import UserInfoVue from "@/views/teacher/UserInfo.vue";
import UpdatePwdVue from "@/views/teacher/UpdatePassword.vue";
import ClassesManageVue from "@/views/classes/ClassesManage.vue";
import GradesManageVue from "@/views/grades/GradesManage.vue";
import CourseManageVue from "@/views/course/CourseManage.vue";
import StudentStatisticVue from "@/views/statistic/StudentStatistic.vue";
import GradesStatisticVue from "@/views/statistic/GradesStatistic.vue";
import ClassStudentNumStaticVue from "@/views/statistic/ClassStudentNumStatic.vue";

//定义路由关系
const routes = [
    {path: '/StudentSystem/login', component: LoginVue},
    {
        path: '/StudentSystem/', component: LayoutVue, redirect: '/StudentSystem/student/manage', children: [
            {path: '/StudentSystem/student/manage', component: StudentManageVue},
            {path: '/StudentSystem/teacher/info', component: UserInfoVue},
            {path: '/StudentSystem/teacher/updatePwd', component: UpdatePwdVue},
            {path: '/StudentSystem/classes/manage', component: ClassesManageVue},
            {path: '/StudentSystem/grades/manage', component: GradesManageVue},
            {path: '/StudentSystem/course/manage', component: CourseManageVue},
            {path: '/StudentSystem/statistics/studentStatistic', component: StudentStatisticVue},
            {path: '/StudentSystem/statistics/gradesStatistic', component: GradesStatisticVue},
            {path: '/StudentSystem/statistics/ClassStudentNumStatic', component: ClassStudentNumStaticVue}
        ]
    },
];


//创建路由器
const router = createRouter({
    history: createWebHistory(),
    routes: routes
})

//导出路由
export default router
